<style>
    select{height: 38px;width:100%;border:1px solid #e6e6e6;padding:5px;}
</style>

<div class="layui-form-pane" style="padding: 20px;">
    <div class="layui-form-item">
        <label class="layui-form-label">昵称</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input" name="nickname" autocomplete="off">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">密码</label>
        <div class="layui-input-block">
            <input type="password" class="layui-input" name="password" autocomplete="off">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">确认密码</label>
        <div class="layui-input-block">
            <input type="password" class="layui-input" name="password_confirm" autocomplete="off">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">邮箱</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input" name="email" autocomplete="off">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">手机</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input" name="mobile" autocomplete="off">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">职位</label>
        <div class="layui-input-block">
            <select name="position">

            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <button id="add" class="layui-btn layui-btn-fluid layui-bg-cyan">提交</button>
    </div>
</div>

<script>
    $(function(){
        GetPositions();
    });

    function GetPositions(){
        var url = '/Handler/User/GetPositionList';
        var data = {page:1,pagesize:99999};
        dink.post(url,data,function(res){
            if(res.ret == 1){
                var target = $('select[name=position]');
                var html = '<option data-id="0" value="0">选择职位</option>';
                $.each(res.data,function(i,ele){
                    if(ele.name != '超级管理员'){
                        html += '<option value="'+ele.id+'">'+ele.name+'</option>';
                    }
                });
                target.html(html);
            }else{
                layer.msg('未获取到数据');
            }
        });
    }
</script>